-
-
Notifications
You must be signed in to change notification settings - Fork 650
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: features OTCR natively in canary #3061
base: main
Are you sure you want to change the base?
feat: features OTCR natively in canary #3061
Conversation
attachEffectById detachEffectById getShader setShader
player:setMapShader("Map - Party")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution. I have a few observations that could help further improve the work.
const auto &enabledFeatures = g_configManager().getEnabledOTCFeatures(); const auto &disabledFeatures = g_configManager().getDisabledOTCFeatures(); for (int32_t feature : enabledFeatures) { g_logger().info("Feature enabled: {}", feature); } for (int32_t feature : disabledFeatures) { g_logger().info("Feature disabled: {}", feature); } Update configmanager.hpp
src/creatures/creature.hpp
Outdated
@@ -695,7 +695,7 @@ class Creature : virtual public Thing, public SharedObject { | |||
std::string getShader() const { | |||
return shader; | |||
} | |||
void setShader(const std::string &shaderName) { | |||
void setShader(const std::string_view &shaderName) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can remove the & as well; passing a std::string_view by reference actually increases overhead. std::string_view is intended to be passed by value since it is simply a lightweight view of the string.
src/creatures/players/player.hpp
Outdated
@@ -1383,7 +1383,7 @@ class Player final : public Creature, public Cylinder, public Bankable { | |||
std::string name; | |||
std::string guildNick; | |||
std::string loyaltyTitle; | |||
std::string mapShader; | |||
std::string_view mapShader; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here, it will remain as std::string. std::string_view is used to avoid copying the string, but in the final context where it needs to be stored or modified, it must be a std::string.
Apologies for the confusion. In the setShader method, you can continue using std::string_view, but for all other methods, they can remain as std::string. PS: If you need, I can help commit. |
@kokekanon |
…/kokekanon/canary3 into kokekanon/all-feature-redemption
reload required ? iOLoginData load, save? need clean Player.cpp
@@ -1719,7 +1719,7 @@ void ProtocolGame::parseSetOutfit(NetworkMessage &msg) { | |||
g_logger().debug("Bool isMounted: {}", isMounted); | |||
} | |||
|
|||
uint8_t isMountRandomized = msg.getByte(); | |||
uint8_t isMountRandomized = !oldProtocol ? msg.getByte() : 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
v8 old protocol no send "isMountRandomized" , last packet is newOutfit.lookMount = msg.get<uint16_t>();
canary read in (L1711)
https://github.com/opentibiabr/otcv8/blob/main/src/client/protocolgamesend.cpp#L833
Redemption 11.00 no send isMountRandomized only in 13.40
msg.addByte(newOutfit.lookMountBody); | ||
msg.addByte(newOutfit.lookMountLegs); | ||
msg.addByte(newOutfit.lookMountFeet); | ||
} | ||
writeToOutputBuffer(msg); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
msg.addByte(outfit.lookMountBody); | ||
msg.addByte(outfit.lookMountLegs); | ||
msg.addByte(outfit.lookMountFeet); | ||
} | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
…/kokekanon/canary3 into kokekanon/all-feature-redemption
…/kokekanon/canary3 into kokekanon/all-feature-redemption
Quality Gate passedIssues Measures |
6/6
for test use this client.exe https://github.com/mehah/otclient/actions/runs/11730256085
or use this in terminal
Description
1.-Creature AE + Shader
no break cipsoft or v8
2.-send disableFeature / enableFeature . easy to modify in config.lua
it is easier for the server administrator to modify config.lua than to compile every time he wants to add or remove a feature.
note1: v8 and otcr send the same packets, so it could be only 1 function, but i don't want to break anything.
note2 : In otcr requires modification in the client * is not yet ready
3.- outfit (wings,aura,shader)
4.- TypingIcon
5.- map shader support
6.- item Shader
Type of change
How Has This Been Tested
1/6 Creature : AttachedEffect | Shader
2/6 Player: Map Shader
4/6 feature: Item Shader
5/6 send disableFeature / enableFeature. easy to modify in config.lua
6/6
Test Configuration:
Checklist
Note: To be honest, I'm not good at C++, and I don't use Canary, I'm not used to the structure.